<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

namespace App\Constants;

use Hyperf\Constants\AbstractConstants;
use Hyperf\Constants\Annotation\Constants;

#[Constants]
class ErrorCode extends AbstractConstants
{
    ###################通用错误码###################
    /**
     * @Message("Server Error！")
     */
    public const SERVER_ERROR = 500;
    /**
     * @Message("成功")
     */
    public const SUCCESS = 0;
    /**
     * @Message("失败")
     */
    public const FAIL = -1;
    ###################通用错误码###################

    ###################鉴权错误码###################
    /**
     * @Message("用户访问令牌无效")
     */
    public const TOKEN_INVALID = 4101;
    /**
     * @Message("用户访问令牌过期")
     */
    public const TOKEN_EXPIRED = 4102;
    /**
     * @Message("用户访问令牌缺失")
     */
    public const TOKEN_MISSING = 4103;
    /**
     * @Message("签名验证失败")
     */
    public const SIGN_VERIFY_FAILED = 4104;
    /**
     * @Message("签名参数缺失")
     */
    public const SIGN_PARAM_MISSING = 4105;
    #################参数错误码######################

    #################业务错误码######################
    /**
     * @Message("参数错误")
     */
    public const PARAM_ERROR = 10001;

    /**
     * @Message("数据不存在")
     */
    public const DATA_NOT_EXIST = 10002;
    /**
     * @Message("路由不存在")
     */
    public const ROUTE_NOT_EXIST = 10003;
    /**
     * @Message("权限不足")
     */
    public const PERMISSION_DENIED = 10004;
    /**
     * @Message("用户不存在或禁用")
     */
    public const USER_NOT_EXIST_OR_FORBID = 10005;
    /**
     * @Message("账号或者密码错误")
     */
    public const USER_PASSWORD_ERROR = 10006;
    /**
     * @Message("权限已存在")
     */
    public const PERMISSION_EXIST = 10007;
    /**
     * @Message("更新失败")
     */
    public const UPDATE_ERROR = 10008;
    /**
     * @Message("删除失败")
     */
    public const DELETE_ERROR = 10009;
    #################业务错误码######################
}
